#ifndef __TOUCH_H__
#define __TOUCH_H__

#include "graphics.h"
#include "ref.h"
#include "screen.h"

#define DEV_TOUCH "/dev/input/event0"
#define SLIDE_THRESHOLD 60

extern uint16_t TOUCH_W;
extern uint16_t TOUCH_H;

typedef enum {
    UNKNOWN,
    CLICK,
    LTR,
    RTL,
    TTB,
    BTT
} Gesture;

typedef struct {
    Point start;
    Point end;
    Gesture gesture;
} TouchEvent;

bool Touch_Init();
void Touch_Free();

bool Touch_CanRead();

int32_t Touch_ReadEvent(struct input_event* ev);
TouchEvent Touch_GetXY();

#endif /* __TOUCH_H__ */
